<?php

/*

  Victory	$6

  Worth 2VP for every 5 differently named cards in your deck (round down).

 */

class Fairgrounds extends Card implements iVictory, iKingdom, iCornucopia {

    public function __construct() {
        parent::__construct("Fair Grounds", 6);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Worth 2VP for every 5 differently named cards in your deck (round down).");
    }
    
        public function getDisplayName($quantity = 1) {
        if ($quantity == 1) {
            return "Fair Grounds";
        }
        return $quantity . " Fair Grounds";
    }
    
    public function getVictoryPoints(Game $game, $name) {
        $allCards = $game->getAllCards($name);
        $unique = getUniqueCards($allCards);
        return floor(2*floor(sizeof($unique)/5));
    }

}

?>